package com.cgtong.android.mvp.contract;

import com.cgtong.android.bean.ProblemBean;
import com.cgtong.android.http.callback.BaseCallBack;
import com.cgtong.android.http.callback.FollowCallBack;
import com.cgtong.android.http.callback.ProblemPageCallBack;
import com.zhouyou.http.exception.ApiException;
import com.zhouyou.http.model.ApiResult;

import java.util.List;

/**
 * 问题分页
 * Created by chunc on 2017/10/23.
 */

public interface ProblemPageContract {
    interface Model {
        void httpProblemsData(String maxTime, String searchTxt, int isDraft, int status, int isExpired, String latitude, String longitude, String beginTime, String endTime, ProblemPageCallBack<List<ProblemBean>> problemPageCallBack);

        void follow(long id, FollowCallBack<ApiResult> followCallBack);

        void httpMyDrafts(ProblemPageCallBack<List<ProblemBean>> problemPageCallBack);

        void deleteDraft(long id, BaseCallBack<ApiResult> baseCallBack);

    }

    interface View {

        void setRefreshing(boolean isRefresh);

        void setEnableLoadMore(boolean enableLoadMore);

        void onLoadMoreEnd(boolean isLoadMoreEnd);

        void onError(ApiException e);

        void onNullData();

        void onSearchNullData();


        void onHttpProblemsDataSuccess(List<ProblemBean> datas, boolean isRefresh);

        void onHttpDraftsSuccess(List<ProblemBean> datas);

        void onFollowSuccess(long id, int position, ApiResult result);

        void onDeleteDraftSuccess(int position, ApiResult result);

    }

    interface Presenter {

        void httpProblemsData(String maxTime, String searchTxt, int isDraft, int status, int isExpired, String latitude, String longitude, String beginTime, String endTime, boolean isRefresh);

        void httpMyDrafts();

        void onDestroy();

        void follow(long id, int position);

        void deleteDraft(long id, int position);


    }

}
